package oop;

/*
    猫 狗：
        共性：姓名、年龄、吃饭
        特性-猫：抓老鼠
            狗：看家
 */
public class Test_Abstract_Animal {
    public static void main(String[] args) {
        Cat1 c = new Cat1("猫",20);
        c.eat();
        c.catchMouse();



    }
}

abstract class Animal1 {
    String name;
    int age;

    public Animal1() {
    }

    public Animal1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public abstract void eat();

}

class Cat1 extends Animal1 {

    @Override
    public void eat() {

    }

    public Cat1() {
        super();
    }

    public Cat1(String name, int age) {
        super(name, age);
    }

    public void catchMouse() {
        System.out.println("猫：" + name);
        System.out.println("年龄：" + age);
        System.out.println("猫吃鱼");
    }
}
